package com.liang.gulimall.cart.service;

import com.liang.gulimall.cart.vo.Cart;
import com.liang.gulimall.cart.vo.CartItem;

import java.util.List;
import java.util.concurrent.ExecutionException;

public interface CartService {
    CartItem addToCart(Long skuId, Integer num) throws ExecutionException, InterruptedException;

    CartItem getCartItem(Long skuId);

    /**
     * 获取整个购物车
     * @return
     */
    Cart getCartInfo() throws ExecutionException, InterruptedException;

    /**
     * 清空购物车
     * @param cartKet
     */
    void clearCart(String cartKet);

    /**
     * 勾选购物车购物项
     * @param skuId
     * @param check
     */
    void checkItem(Long skuId, Integer check);

    /**
     * 改变购物车商品数量
     * @param skuId
     * @param count
     */
    void setCountItem(Long skuId, Integer count);

    /**
     * 删除购物车商品
     * @param skuId
     */
    void deleteItem(Long skuId);

    /**
     * 订单结算的购物项
     * @return
     */
    List<CartItem> getUserCheckedItem();
}
